<?php

include_once '../web_inc.php';
include_once './config/db_conn.php';
include_once 'smarty_inc.php';
include_once 'inc/school_class.php';



$smarty->assign("name","城市添加");
$smarty->assign("path",ROOT_PATH);


$city=new adminNew();
$sql=$city->query();
while($cname=$city->get($sql)){
	$cheng[]=array("city"=>$cname[cname],
		                    "id"=>$cname[id]
		                  );
    $smarty->assign("city",$cheng);
}



if($_GET['action']==add_school){
	$cid=$_POST['city'];
	$name=$_POST['name'];


	if(empty($_POST['hot'])){
		$hot="1";
	}else{
		$hot="0";
	}

	$city=new adminNew();
	$city->add_school($cid,$name,$hot);
}




$smarty->display("admin/add_school.htm");
?>
